package com.tianji.learning.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.dto.ReplyDTO;
import com.tianji.learning.domain.query.ReplyPageQuery;
import com.tianji.learning.domain.vo.ReplyVO;
import com.tianji.learning.service.IInteractionReplyService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 互动问题的回答或评论 前端控制器
 * </p>
 *
 * @author hrz
 * @since 2025-08-29
 */
@RestController
@RequestMapping("/admin/replies")
@RequiredArgsConstructor
public class InteractionReplyAdminController {
    private final IInteractionReplyService replyService;

    @GetMapping("/page")
    @ApiOperation("管理端分页查询")
    public PageDTO<ReplyVO> page(@RequestBody ReplyPageQuery replyPageQuery){
        return replyService.Adminpagequery(replyPageQuery);
    }

    @PutMapping("/{id}/hidden/{hidden}")
    @ApiOperation("管理端隐藏回复")
    public void hideReply(@PathVariable("id") Long replyId,
                          @PathVariable("hidden") boolean hidden){
        replyService.hideReply(replyId,hidden);
    }
}
